package com.example.myproject.util;

import com.qiaofang.common.mq.rabbitmq.bean.MqSendData;
import sun.misc.BASE64Decoder;

import java.io.ByteArrayInputStream;
import java.io.ObjectInputStream;

/**
 * Created by Administrator on 2018/3/15.
 */
public class SerialUtilMqSendData {
    public static void main(String args[]){

        String str ="SerialUtil";
        BASE64Decoder base64Decoder = new BASE64Decoder();
        MqSendData temp = null;
        try {
            byte[] byteArr = base64Decoder.decodeBuffer(str);
            ObjectInputStream objIn= null;
            objIn = new ObjectInputStream(new ByteArrayInputStream(byteArr,0,byteArr.length));
            temp = (MqSendData) objIn.readObject();
            System.out.println("tmp："+temp.getMsgId());
        } catch (Exception e) {
            e.printStackTrace();
        }


    }
}
